
// 基于template/src/views/{{appModules}}/{{pages@DEWFDYNAEDITVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	WFDynaEditViewActionType,
	WFDynaEditViewController,
	IWFDynaEditViewAbility,
	IWFDynaEditViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useWFDynaEditViewProps,
	useWFDynaEditViewBasic,
	useWFDynaEditViewControllerParams,
    useWFDynaEditViewAction,
} from '@/hooks/view/use-wfdyna-edit-view';
import { model } from "./ibiz-sample-0021-usr-1114433946-wf-dyna-edit-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useWFDynaEditViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useWFDynaEditViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useWFDynaEditViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<WFDynaEditViewActionType, IWFDynaEditViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<WFDynaEditViewActionType, IWFDynaEditViewAbility>>
) {
	const params: IWFDynaEditViewControllerParams<
		WFDynaEditViewActionType,
		IWFDynaEditViewAbility
	> = useWFDynaEditViewControllerParams(model, props, evt);
	return new WFDynaEditViewController(params);
}